﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static WinForm1.MainForm;

namespace WinForm1
{
    public partial class FindForm : Form
    {
        public event FindFormConfirmEventHandler FindFormConfirm;

        public FindForm()
        {
            InitializeComponent();
        }

        private void FindForm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                Cancel.PerformClick();
            }
            if (e.KeyCode == Keys.F8)
            {
                Confirm.PerformClick();
            }
        }

        private void Cancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void Confirm_Click(object sender, EventArgs e)
        {
            if (PathWord.Text.Length<=0)
            {
                MessageBox.Show("请输入要检索的文件名。","提示");
                return;
            }
            String findWord = PathWord.Text;
            FindFormConfirm(findWord);
            Close();
        }

        private void DoneL_Click(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }
    }
}
